<?php
class FE_best extends CI_Controller {
	
	function FE_best() {
		parent::__construct();
		$this->load->model('fe/bestmodel');
	}
	
	function index() {
		//$this->get_price_icons(18);
		//$this->get_time_icons(18);
		$this->loadProviders();
	}
	
	function get_price_icons($provider_id) {
		$result = $this->bestmodel->get_price_icons($provider_id);
		$icons = array();
		$index = 0; 
		foreach ($result as $item) {
			$icons[$index] = '<img src="' . base_url() . $item . '" />';
			//echo $icons[$index];
			$index++;
		}
	}
	
	function get_time_icons($provider_id) {
		$result = $this->bestmodel->get_time_icons($provider_id);
		$icons = array();
		$index = 0; 
		foreach ($result as $item) {
			$icons[$index] = '<img src="' . base_url() . $item . '" />';
			//echo $icons[$index];
			$index++;
		}
		
	}
	
	function loadProviders() {
		$data['providers'] = $this->bestmodel->getProvider();
		$data['page_title'] = 'Tốt nhất';
		$data['main_content'] = 'fe/best_view';
		$this->load->view('fe/includes/template', $data);
	}
}